home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / gnused.zip / GNUSED / MAKEFILE < prev    next >
Text File  |  1992-11-08  |  3KB  |  119 lines

  1. #
  2. # Hacked up Nmake makefile for GNU Sed.
  3. #
  4. # TimF, ArdenW    17-Apr-92
  5. #
  6.  
  7.  
  8. # You must have a couple of environment variables set:
  9. #
  10. #     BUILD_DEFAULT_TARGETS must be set to one of "-mips" or "-386",
  11. #        Build for mips assumes r4000.
  12. #
  13. #    INC must ne set the full path to your NT .h files.
  14. #
  15. #    LIB must be set to the full path to your NT .lib files.
  16. #        (coffbase.txt must be at $(LIB)\..\coffbase.txt
  17. #
  18. #
  19. !IF "$(CPU)" == "i386"
  20. BUILD_DEFAULT_TARGETS=-386
  21. !ENDIF
  22. !IF "$(CPU)" == "MIPS"
  23. BUILD_DEFAULT_TARGETS=-mips
  24. !ENDIF
  25. INC=$(INCLUDE)
  26.  
  27. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  28. # Set up the compiler flags for building on mips
  29.  
  30. # I wonder how many of the flags aren't required for anything but building a
  31. # kernel...
  32.  
  33. CFLAGS = -std -Wb,-dwalign -G 0 -std -checkstack 4096 -excpt -g0 -O -EL    \
  34.     -c -Wab,-mips2 -Wab,-diag -DMIPS=1 -DNO_EXT_KEYS -DMIPSEL     \
  35.     -DCONDITION_HANDLING=1 -DNT_INST=0 -DNT_UP=1 -DJAZZ -DR4000
  36.  
  37. !ELSE
  38. !IF "$(BUILD_DEFAULT_TARGETS)" == "-386"
  39. # Set up the compiler flags for building on x86
  40.  
  41. CFLAGS = -nologo -Di386=1 -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0    \
  42.     -DDBG=1 -DDEVL=1 -c -Zel -W4 -H63 -G3d -Ox -Zd
  43.  
  44. !ELSE
  45. !ERROR You must specify BUILD_DEFAULT_TARGETS as either -386 or -mips.
  46. !ENDIF
  47. !ENDIF
  48.  
  49.  
  50. !IFNDEF INC
  51. !ERROR You need to set INC to the NT .h files directory.
  52. !ELSE
  53. INCP = -I. -I$(INC) -I$(INC)\crt
  54. !ENDIF
  55.  
  56.  
  57. !IFNDEF LIB
  58. !ERROR You need to set LIB to the NT .lib files directory.
  59. !ENDIF
  60.  
  61.  
  62. GENERICFLAGS = -DWINDOWSNT=1 -DSTDC_HEADERS=1
  63.  
  64.  
  65. NAME =    sed
  66.  
  67. TARGET= $(BLD)\$(NAME).exe
  68. TLIB =    $(BLD)\$(NAME).lib
  69. TOBJ =    $(BLD)\$(NAME).obj
  70.  
  71. BLD =    obj
  72.  
  73.  
  74. OBJ =    $(BLD)\alloca.obj    \
  75.     $(BLD)\getopt.obj    \
  76.     $(BLD)\getopt1.obj    \
  77.     $(BLD)\malloc.obj    \
  78.     $(BLD)\regex.obj    \
  79.     $(BLD)\utils.obj
  80.  
  81.  
  82. LIBS =    $(TLIB)            \
  83.     $(LIB)\setargv.obj    \
  84.     $(LIB)\kernel32.lib    \
  85.     $(LIB)\libc.lib        \
  86.     $(LIB)\ntdll.lib
  87.  
  88.  
  89. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  90. $(TARGET): $(LIBS) $(TOBJ)
  91.     @- coff -LINK -out:$(TARGET) -debug:PARTIAL -machine:mips -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
  92.  
  93. $(TLIB): $(OBJ)
  94.     @- coff -lib -out:$(TLIB) $**
  95.  
  96. .c{$(BLD)}.obj:
  97.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  98.     @- chmode -r $@ >nul 2>&1
  99.     @- del $@ >nul 2>&1
  100.     @- echo cc $<
  101.     @- cc $(CFLAGS) $(GENERICFLAGS) $(INCP) -Olimit 1250 -o $@ $<
  102.     @- mip2coff $@
  103. !ELSE
  104. $(TARGET): $(LIBS) $(TOBJ)
  105.     link -out:$(TARGET) -debug:PARTIAL -machine:i386 -align:0x1000 -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
  106.  
  107. $(TLIB): $(OBJ)
  108.     lib -out:$(TLIB) $**
  109.  
  110. .c{$(BLD)}.obj:
  111.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  112.     @- chmode -r $@ >nul 2>&1
  113.     @- del $@ >nul 2>&1
  114.     cl386 $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  115.     @- cvtomf $@
  116. !ENDIF
  117.  
  118.  
  119.